package com.chen.project.white_jotter.service;

import com.chen.project.white_jotter.mapper.CategoryMapper;
import com.chen.project.white_jotter.pojo.Category;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CategoryService {

    @Resource
    private CategoryMapper categoryMapper;

    public List<Category> getCategoryList(){
        return categoryMapper.selectAllByIdDesc();
    }

    public Category getById(Integer id){
        return categoryMapper.selectByPrimaryKey(id);
    }
}
